<?php
require_once('../phplib/include.inc.php');

class DoAddProduct{
	public function DoAdd(){
		$R = $_REQUEST;
		$pid = intval($R['pid']);
		Util::HaveRight_Or(array(1,$pid*10+1));
		$tid = intval($R['ptype']);
		$cxrl = ($R['cxrl']);
		$gjcl = $R['gjcl'];
		$hfbh = ($R['hfbh']);
		$sssd = ($R['sssd']);
		$dhcd = ($R['dhcd']);
		$tlxz = ($R['tlxz']);
		$hsxz = ($R['hsxz']);
		$czms = ($R['czms']);
		$hscl = $R['hscl'];
		$hszj = ($R['hszj']);
		$bhqt = $R['bhqt'];
		$arr = array($tid,$cxrl,$gjcl,$hfbh,$sssd,$dhcd,$tlxz,$hsxz,$czms,$hscl,$hszj,$bhqt,$pid);
		/* @var $db DbMySQL */
		$db = getDb();
		$db->connect();
		$sql = "UPDATE
				  `product_t`
				SET
				   tid={0},
				  cxrl={1},
				  gjcl={2},
				  hfbh={3},
				  sssd={4},
				  dhcd={5},
				  tlxz={6},
				  hsxz={7},
				  czms={8},
				  hscl={9},
				  hszj={10},
				  bhqt={11}
				WHERE pid={12}";
		$re = $db->execute($sql,$arr);
		if($re === false){
			PageBase::Error('修改焊接数据时出错，未知错误，请与技术人员联系.');
		}
		Util::AddLog("修改焊接数据, 该焊接数据的id为: $pid ");
		PageBase::Go('../home/productadmin.php');
	}
}
$doaddproduct = new DoAddProduct();
$doaddproduct->DoAdd();
?>